<div class="row">
	<div class="panel">
		<h6>Edit Subject</h6>
	</div>
	<?if(isset($system_message))echo $system_message;?>
	<?php 
		$formAttrib = array('id' => 'addsubject', 'class' => 'admin-form');
		$roomLevelAttrib = array('' => 'Select level assignment..');
		$subjectNameAttrib = array('name' => 'code', 'value' => set_value('code',$subject->subj_code), 'id' => 'name');
		$subjectStatusAttrib = array('active' => 'Active', 'inactive' => 'Inactive');
		$time = !empty($subject->time)? explode('-',$subject->time) : array('0'=>'0:00','1'=>'0:00');
		
		echo form_open('room_section_subject/edit_subject/'.$subject->subj_id, $formAttrib);
		foreach($levels as $level){
			$roomLevelAttrib[$level->level_id] = strtoupper($level->level_code).' - '.$level->level_desc;
		}
	?>
    
    <div class="alert-box secondary">

    <div class="row">
	    <div class="large-6 columns">
	    	<label  class="label label-success">Grade Level</label>
	    	<?= form_dropdown('grade_level_id', $roomLevelAttrib, $subject->grade_level_id);	?>
	    </div>
		
<!-- 		<div class="large-6 columns">
			<label class="label label-success">Academic Year:</label>
			<?php// echo form_dropdown('academic_year', $academic_year, $subject->for_academic_year);	?>
	    </div> -->
    </div>
    
    <div class="row">
	    <div class="large-6 columns">
	    	<label  class="label label-success">Subject Code</label>
		    <?php
				echo form_hidden('subj_id', $subject->subj_id);
				echo form_input($subjectNameAttrib);
			?>
	    </div>
	    <div class="large-6 columns">
	    	<label  class="label label-success">Subject Status</label>
	    	<?= form_dropdown('subj_stat', $subjectStatusAttrib, $subject->subj_stat);	?>
	    </div>
    </div>

	<div class="row">
		<div class="large-6 columns">
			<label class="label label-success">Notes</label>
			<input type="text" name="subj_uniq_id" value="<?=set_value('subj_uniq_id',$subject->subj_uniq_id);?>" placeholder="Notes for this subject">
	    </div>
	    
		<div class="large-6 columns">
			<label class="label label-success">Subject Name/Description</label>
			<input type="text" name="description" value="<?=set_value('description',$subject->subj_desc);?>">
	    </div>
    </div>
	
	<div class="row">
<!-- 		<div class="large-6 columns">
			<label class="label label-success">Subject Main Parent</label>
			<input type="text" id="parent_subject" name="subject_parent" step="any" value="<?=set_value('subject_parent',$subject->subject_name);?>">
		</div> -->
		<div class="large-6 columns">
			<label class="label label-success">Subject Unit:</label>
			<input type="number" max="10" min="0" required name="subject_unit" step="any" value="<?=set_value('subject_unit',$subject->subj_units);?>">
		</div>
	</div>
	<div class="row">
		<!--<div class="large-6 columns">
			<label class="label label-success">Additional Subject Skills</label><span class="info">Separated by semicolon(;)</span>
			<!-- <input type="text" id="parent_subject" name="subject_parent" step="any" value="<?//=set_value('subject_parent',$subject->subject_name);?>"> ==>
			<textarea name="subject_children"><?=set_value('subject_children',$subject->children);?></textarea>
		</div>
		-->
	</div>
   
    <div class="input-block" style="clear:both;">
		<?php echo form_submit('save', 'Save Changes','class="btn btn-small btn-primary"'); ?>
		<hr class="clearfix">
    	<a href="<?=site_url('room_section_subject/subjects');?>" class="btn">Back to Subjects</a>
	</div>
	</form>
	</div>
</div>
  <script>
  $(document).ready(function(){
  	  $(function() {
	    $( "#parent_subject" ).autocomplete({
	      source: "<?=site_url('output/returall_subjectparent');?>"
	    });
	  });
  });
  </script>